<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>digichef.tagging.managers</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="digichef-module.html">Package&nbsp;digichef</a> ::
        <a href="digichef.tagging-module.html">Package&nbsp;tagging</a> ::
        Module&nbsp;managers
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="digichef.tagging.managers-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="digichef.tagging.managers-module.html">Module digichef.tagging.managers</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno"> 1</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L2"></a><tt class="py-lineno"> 2</tt>  <tt class="py-line"><tt class="py-docstring">Custom managers for Django models registered with the tagging</tt> </tt>
<a name="L3"></a><tt class="py-lineno"> 3</tt>  <tt class="py-line"><tt class="py-docstring">application.</tt> </tt>
<a name="L4"></a><tt class="py-lineno"> 4</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L5"></a><tt class="py-lineno"> 5</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">django</tt><tt class="py-op">.</tt><tt class="py-name">contrib</tt><tt class="py-op">.</tt><tt class="py-name">contenttypes</tt><tt class="py-op">.</tt><tt id="link-0" class="py-name" targets="Module digichef.core.models=digichef.core.models-module.html,Module digichef.profiles.models=digichef.profiles.models-module.html,Module digichef.recipes.models=digichef.recipes.models-module.html,Module digichef.recommender.models=digichef.recommender.models-module.html,Module digichef.registration.models=digichef.registration.models-module.html,Module digichef.tagging.models=digichef.tagging.models-module.html,Module digichef.tagging.tests.models=digichef.tagging.tests.models-module.html,Module digichef.util.models=digichef.util.models-module.html,Module digichef.voting.models=digichef.voting.models-module.html,Module digichef.voting.tests.models=digichef.voting.tests.models-module.html"><a title="digichef.core.models
digichef.profiles.models
digichef.recipes.models
digichef.recommender.models
digichef.registration.models
digichef.tagging.models
digichef.tagging.tests.models
digichef.util.models
digichef.voting.models
digichef.voting.tests.models" class="py-name" href="#" onclick="return doclink('link-0', 'models', 'link-0');">models</a></tt> <tt class="py-keyword">import</tt> <tt class="py-name">ContentType</tt> </tt>
<a name="L6"></a><tt class="py-lineno"> 6</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">django</tt><tt class="py-op">.</tt><tt class="py-name">db</tt> <tt class="py-keyword">import</tt> <tt id="link-1" class="py-name"><a title="digichef.core.models
digichef.profiles.models
digichef.recipes.models
digichef.recommender.models
digichef.registration.models
digichef.tagging.models
digichef.tagging.tests.models
digichef.util.models
digichef.voting.models
digichef.voting.tests.models" class="py-name" href="#" onclick="return doclink('link-1', 'models', 'link-0');">models</a></tt> </tt>
<a name="L7"></a><tt class="py-lineno"> 7</tt>  <tt class="py-line"> </tt>
<a name="L8"></a><tt class="py-lineno"> 8</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-2" class="py-name" targets="Package digichef.tagging=digichef.tagging-module.html"><a title="digichef.tagging" class="py-name" href="#" onclick="return doclink('link-2', 'tagging', 'link-2');">tagging</a></tt><tt class="py-op">.</tt><tt id="link-3" class="py-name"><a title="digichef.core.models
digichef.profiles.models
digichef.recipes.models
digichef.recommender.models
digichef.registration.models
digichef.tagging.models
digichef.tagging.tests.models
digichef.util.models
digichef.voting.models
digichef.voting.tests.models" class="py-name" href="#" onclick="return doclink('link-3', 'models', 'link-0');">models</a></tt> <tt class="py-keyword">import</tt> <tt id="link-4" class="py-name" targets="Class digichef.tagging.models.Tag=digichef.tagging.models.Tag-class.html"><a title="digichef.tagging.models.Tag" class="py-name" href="#" onclick="return doclink('link-4', 'Tag', 'link-4');">Tag</a></tt><tt class="py-op">,</tt> <tt id="link-5" class="py-name" targets="Class digichef.tagging.models.TaggedItem=digichef.tagging.models.TaggedItem-class.html"><a title="digichef.tagging.models.TaggedItem" class="py-name" href="#" onclick="return doclink('link-5', 'TaggedItem', 'link-5');">TaggedItem</a></tt> </tt>
<a name="L9"></a><tt class="py-lineno"> 9</tt>  <tt class="py-line"> </tt>
<a name="ModelTagManager"></a><div id="ModelTagManager-def"><a name="L10"></a><tt class="py-lineno">10</tt> <a class="py-toggle" href="#" id="ModelTagManager-toggle" onclick="return toggle('ModelTagManager');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="digichef.tagging.managers.ModelTagManager-class.html">ModelTagManager</a><tt class="py-op">(</tt><tt class="py-base-class">models</tt><tt class="py-op">.</tt><tt class="py-base-class">Manager</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ModelTagManager-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="ModelTagManager-expanded"><a name="L11"></a><tt class="py-lineno">11</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L12"></a><tt class="py-lineno">12</tt>  <tt class="py-line"><tt class="py-docstring">    A manager for retrieving tags for a particular model.</tt> </tt>
<a name="L13"></a><tt class="py-lineno">13</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="ModelTagManager.get_query_set"></a><div id="ModelTagManager.get_query_set-def"><a name="L14"></a><tt class="py-lineno">14</tt> <a class="py-toggle" href="#" id="ModelTagManager.get_query_set-toggle" onclick="return toggle('ModelTagManager.get_query_set');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="digichef.tagging.managers.ModelTagManager-class.html#get_query_set">get_query_set</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ModelTagManager.get_query_set-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="ModelTagManager.get_query_set-expanded"><a name="L15"></a><tt class="py-lineno">15</tt>  <tt class="py-line">        <tt class="py-name">ctype</tt> <tt class="py-op">=</tt> <tt class="py-name">ContentType</tt><tt class="py-op">.</tt><tt id="link-6" class="py-name" targets="Variable digichef.recommender.models.Recommender.objects=digichef.recommender.models.Recommender-class.html#objects,Variable digichef.registration.models.RegistrationProfile.objects=digichef.registration.models.RegistrationProfile-class.html#objects,Variable digichef.tagging.models.Tag.objects=digichef.tagging.models.Tag-class.html#objects,Variable digichef.tagging.models.TaggedItem.objects=digichef.tagging.models.TaggedItem-class.html#objects,Variable digichef.voting.models.Vote.objects=digichef.voting.models.Vote-class.html#objects"><a title="digichef.recommender.models.Recommender.objects
digichef.registration.models.RegistrationProfile.objects
digichef.tagging.models.Tag.objects
digichef.tagging.models.TaggedItem.objects
digichef.voting.models.Vote.objects" class="py-name" href="#" onclick="return doclink('link-6', 'objects', 'link-6');">objects</a></tt><tt class="py-op">.</tt><tt class="py-name">get_for_model</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-7" class="py-name" targets="Variable digichef.profiles.forms.ProfileForm.Meta.model=digichef.profiles.forms.ProfileForm.Meta-class.html#model,Variable digichef.tagging.forms.TagAdminForm.Meta.model=digichef.tagging.forms.TagAdminForm.Meta-class.html#model"><a title="digichef.profiles.forms.ProfileForm.Meta.model
digichef.tagging.forms.TagAdminForm.Meta.model" class="py-name" href="#" onclick="return doclink('link-7', 'model', 'link-7');">model</a></tt><tt class="py-op">)</tt> </tt>
<a name="L16"></a><tt class="py-lineno">16</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-8" class="py-name"><a title="digichef.tagging.models.Tag" class="py-name" href="#" onclick="return doclink('link-8', 'Tag', 'link-4');">Tag</a></tt><tt class="py-op">.</tt><tt id="link-9" class="py-name"><a title="digichef.recommender.models.Recommender.objects
digichef.registration.models.RegistrationProfile.objects
digichef.tagging.models.Tag.objects
digichef.tagging.models.TaggedItem.objects
digichef.voting.models.Vote.objects" class="py-name" href="#" onclick="return doclink('link-9', 'objects', 'link-6');">objects</a></tt><tt class="py-op">.</tt><tt class="py-name">filter</tt><tt class="py-op">(</tt> </tt>
<a name="L17"></a><tt class="py-lineno">17</tt>  <tt class="py-line">            <tt class="py-name">items__content_type__pk</tt><tt class="py-op">=</tt><tt class="py-name">ctype</tt><tt class="py-op">.</tt><tt class="py-name">pk</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">distinct</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L18"></a><tt class="py-lineno">18</tt>  <tt class="py-line"> </tt>
<a name="ModelTagManager.cloud"></a><div id="ModelTagManager.cloud-def"><a name="L19"></a><tt class="py-lineno">19</tt> <a class="py-toggle" href="#" id="ModelTagManager.cloud-toggle" onclick="return toggle('ModelTagManager.cloud');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="digichef.tagging.managers.ModelTagManager-class.html#cloud">cloud</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-op">*</tt><tt class="py-param">args</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-param">kwargs</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ModelTagManager.cloud-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="ModelTagManager.cloud-expanded"><a name="L20"></a><tt class="py-lineno">20</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-10" class="py-name"><a title="digichef.tagging.models.Tag" class="py-name" href="#" onclick="return doclink('link-10', 'Tag', 'link-4');">Tag</a></tt><tt class="py-op">.</tt><tt id="link-11" class="py-name"><a title="digichef.recommender.models.Recommender.objects
digichef.registration.models.RegistrationProfile.objects
digichef.tagging.models.Tag.objects
digichef.tagging.models.TaggedItem.objects
digichef.voting.models.Vote.objects" class="py-name" href="#" onclick="return doclink('link-11', 'objects', 'link-6');">objects</a></tt><tt class="py-op">.</tt><tt id="link-12" class="py-name" targets="Method digichef.tagging.models.TagManager.cloud_for_model()=digichef.tagging.models.TagManager-class.html#cloud_for_model"><a title="digichef.tagging.models.TagManager.cloud_for_model" class="py-name" href="#" onclick="return doclink('link-12', 'cloud_for_model', 'link-12');">cloud_for_model</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-13" class="py-name"><a title="digichef.profiles.forms.ProfileForm.Meta.model
digichef.tagging.forms.TagAdminForm.Meta.model" class="py-name" href="#" onclick="return doclink('link-13', 'model', 'link-7');">model</a></tt><tt class="py-op">,</tt> <tt class="py-op">*</tt><tt class="py-name">args</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-name">kwargs</tt><tt class="py-op">)</tt> </tt>
</div><a name="L21"></a><tt class="py-lineno">21</tt>  <tt class="py-line"> </tt>
<a name="ModelTagManager.related"></a><div id="ModelTagManager.related-def"><a name="L22"></a><tt class="py-lineno">22</tt> <a class="py-toggle" href="#" id="ModelTagManager.related-toggle" onclick="return toggle('ModelTagManager.related');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="digichef.tagging.managers.ModelTagManager-class.html#related">related</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">tags</tt><tt class="py-op">,</tt> <tt class="py-op">*</tt><tt class="py-param">args</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-param">kwargs</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ModelTagManager.related-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="ModelTagManager.related-expanded"><a name="L23"></a><tt class="py-lineno">23</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-14" class="py-name"><a title="digichef.tagging.models.Tag" class="py-name" href="#" onclick="return doclink('link-14', 'Tag', 'link-4');">Tag</a></tt><tt class="py-op">.</tt><tt id="link-15" class="py-name"><a title="digichef.recommender.models.Recommender.objects
digichef.registration.models.RegistrationProfile.objects
digichef.tagging.models.Tag.objects
digichef.tagging.models.TaggedItem.objects
digichef.voting.models.Vote.objects" class="py-name" href="#" onclick="return doclink('link-15', 'objects', 'link-6');">objects</a></tt><tt class="py-op">.</tt><tt id="link-16" class="py-name" targets="Method digichef.tagging.models.TagManager.related_for_model()=digichef.tagging.models.TagManager-class.html#related_for_model"><a title="digichef.tagging.models.TagManager.related_for_model" class="py-name" href="#" onclick="return doclink('link-16', 'related_for_model', 'link-16');">related_for_model</a></tt><tt class="py-op">(</tt><tt id="link-17" class="py-name" targets="Variable digichef.recipes.models.Recipe.tags=digichef.recipes.models.Recipe-class.html#tags,Variable digichef.tagging.tests.models.FormTest.tags=digichef.tagging.tests.models.FormTest-class.html#tags"><a title="digichef.recipes.models.Recipe.tags
digichef.tagging.tests.models.FormTest.tags" class="py-name" href="#" onclick="return doclink('link-17', 'tags', 'link-17');">tags</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-18" class="py-name"><a title="digichef.profiles.forms.ProfileForm.Meta.model
digichef.tagging.forms.TagAdminForm.Meta.model" class="py-name" href="#" onclick="return doclink('link-18', 'model', 'link-7');">model</a></tt><tt class="py-op">,</tt> <tt class="py-op">*</tt><tt class="py-name">args</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-name">kwargs</tt><tt class="py-op">)</tt> </tt>
</div><a name="L24"></a><tt class="py-lineno">24</tt>  <tt class="py-line"> </tt>
<a name="ModelTagManager.usage"></a><div id="ModelTagManager.usage-def"><a name="L25"></a><tt class="py-lineno">25</tt> <a class="py-toggle" href="#" id="ModelTagManager.usage-toggle" onclick="return toggle('ModelTagManager.usage');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="digichef.tagging.managers.ModelTagManager-class.html#usage">usage</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-op">*</tt><tt class="py-param">args</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-param">kwargs</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ModelTagManager.usage-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="ModelTagManager.usage-expanded"><a name="L26"></a><tt class="py-lineno">26</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-19" class="py-name"><a title="digichef.tagging.models.Tag" class="py-name" href="#" onclick="return doclink('link-19', 'Tag', 'link-4');">Tag</a></tt><tt class="py-op">.</tt><tt id="link-20" class="py-name"><a title="digichef.recommender.models.Recommender.objects
digichef.registration.models.RegistrationProfile.objects
digichef.tagging.models.Tag.objects
digichef.tagging.models.TaggedItem.objects
digichef.voting.models.Vote.objects" class="py-name" href="#" onclick="return doclink('link-20', 'objects', 'link-6');">objects</a></tt><tt class="py-op">.</tt><tt id="link-21" class="py-name" targets="Method digichef.tagging.models.TagManager.usage_for_model()=digichef.tagging.models.TagManager-class.html#usage_for_model"><a title="digichef.tagging.models.TagManager.usage_for_model" class="py-name" href="#" onclick="return doclink('link-21', 'usage_for_model', 'link-21');">usage_for_model</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-22" class="py-name"><a title="digichef.profiles.forms.ProfileForm.Meta.model
digichef.tagging.forms.TagAdminForm.Meta.model" class="py-name" href="#" onclick="return doclink('link-22', 'model', 'link-7');">model</a></tt><tt class="py-op">,</tt> <tt class="py-op">*</tt><tt class="py-name">args</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-name">kwargs</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L27"></a><tt class="py-lineno">27</tt>  <tt class="py-line"> </tt>
<a name="ModelTaggedItemManager"></a><div id="ModelTaggedItemManager-def"><a name="L28"></a><tt class="py-lineno">28</tt> <a class="py-toggle" href="#" id="ModelTaggedItemManager-toggle" onclick="return toggle('ModelTaggedItemManager');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="digichef.tagging.managers.ModelTaggedItemManager-class.html">ModelTaggedItemManager</a><tt class="py-op">(</tt><tt class="py-base-class">models</tt><tt class="py-op">.</tt><tt class="py-base-class">Manager</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ModelTaggedItemManager-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="ModelTaggedItemManager-expanded"><a name="L29"></a><tt class="py-lineno">29</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L30"></a><tt class="py-lineno">30</tt>  <tt class="py-line"><tt class="py-docstring">    A manager for retrieving model instances based on their tags.</tt> </tt>
<a name="L31"></a><tt class="py-lineno">31</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="ModelTaggedItemManager.related_to"></a><div id="ModelTaggedItemManager.related_to-def"><a name="L32"></a><tt class="py-lineno">32</tt> <a class="py-toggle" href="#" id="ModelTaggedItemManager.related_to-toggle" onclick="return toggle('ModelTaggedItemManager.related_to');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="digichef.tagging.managers.ModelTaggedItemManager-class.html#related_to">related_to</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">obj</tt><tt class="py-op">,</tt> <tt class="py-param">queryset</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">num</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ModelTaggedItemManager.related_to-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="ModelTaggedItemManager.related_to-expanded"><a name="L33"></a><tt class="py-lineno">33</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">queryset</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L34"></a><tt class="py-lineno">34</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt id="link-23" class="py-name"><a title="digichef.tagging.models.TaggedItem" class="py-name" href="#" onclick="return doclink('link-23', 'TaggedItem', 'link-5');">TaggedItem</a></tt><tt class="py-op">.</tt><tt id="link-24" class="py-name"><a title="digichef.recommender.models.Recommender.objects
digichef.registration.models.RegistrationProfile.objects
digichef.tagging.models.Tag.objects
digichef.tagging.models.TaggedItem.objects
digichef.voting.models.Vote.objects" class="py-name" href="#" onclick="return doclink('link-24', 'objects', 'link-6');">objects</a></tt><tt class="py-op">.</tt><tt id="link-25" class="py-name" targets="Method digichef.tagging.models.TaggedItemManager.get_related()=digichef.tagging.models.TaggedItemManager-class.html#get_related"><a title="digichef.tagging.models.TaggedItemManager.get_related" class="py-name" href="#" onclick="return doclink('link-25', 'get_related', 'link-25');">get_related</a></tt><tt class="py-op">(</tt><tt class="py-name">obj</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-26" class="py-name"><a title="digichef.profiles.forms.ProfileForm.Meta.model
digichef.tagging.forms.TagAdminForm.Meta.model" class="py-name" href="#" onclick="return doclink('link-26', 'model', 'link-7');">model</a></tt><tt class="py-op">,</tt> <tt class="py-name">num</tt><tt class="py-op">=</tt><tt class="py-name">num</tt><tt class="py-op">)</tt> </tt>
<a name="L35"></a><tt class="py-lineno">35</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L36"></a><tt class="py-lineno">36</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt id="link-27" class="py-name"><a title="digichef.tagging.models.TaggedItem" class="py-name" href="#" onclick="return doclink('link-27', 'TaggedItem', 'link-5');">TaggedItem</a></tt><tt class="py-op">.</tt><tt id="link-28" class="py-name"><a title="digichef.recommender.models.Recommender.objects
digichef.registration.models.RegistrationProfile.objects
digichef.tagging.models.Tag.objects
digichef.tagging.models.TaggedItem.objects
digichef.voting.models.Vote.objects" class="py-name" href="#" onclick="return doclink('link-28', 'objects', 'link-6');">objects</a></tt><tt class="py-op">.</tt><tt id="link-29" class="py-name"><a title="digichef.tagging.models.TaggedItemManager.get_related" class="py-name" href="#" onclick="return doclink('link-29', 'get_related', 'link-25');">get_related</a></tt><tt class="py-op">(</tt><tt class="py-name">obj</tt><tt class="py-op">,</tt> <tt class="py-name">queryset</tt><tt class="py-op">,</tt> <tt class="py-name">num</tt><tt class="py-op">=</tt><tt class="py-name">num</tt><tt class="py-op">)</tt> </tt>
</div><a name="L37"></a><tt class="py-lineno">37</tt>  <tt class="py-line"> </tt>
<a name="ModelTaggedItemManager.with_all"></a><div id="ModelTaggedItemManager.with_all-def"><a name="L38"></a><tt class="py-lineno">38</tt> <a class="py-toggle" href="#" id="ModelTaggedItemManager.with_all-toggle" onclick="return toggle('ModelTaggedItemManager.with_all');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="digichef.tagging.managers.ModelTaggedItemManager-class.html#with_all">with_all</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">tags</tt><tt class="py-op">,</tt> <tt class="py-param">queryset</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ModelTaggedItemManager.with_all-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="ModelTaggedItemManager.with_all-expanded"><a name="L39"></a><tt class="py-lineno">39</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">queryset</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L40"></a><tt class="py-lineno">40</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt id="link-30" class="py-name"><a title="digichef.tagging.models.TaggedItem" class="py-name" href="#" onclick="return doclink('link-30', 'TaggedItem', 'link-5');">TaggedItem</a></tt><tt class="py-op">.</tt><tt id="link-31" class="py-name"><a title="digichef.recommender.models.Recommender.objects
digichef.registration.models.RegistrationProfile.objects
digichef.tagging.models.Tag.objects
digichef.tagging.models.TaggedItem.objects
digichef.voting.models.Vote.objects" class="py-name" href="#" onclick="return doclink('link-31', 'objects', 'link-6');">objects</a></tt><tt class="py-op">.</tt><tt id="link-32" class="py-name" targets="Method digichef.tagging.models.TaggedItemManager.get_by_model()=digichef.tagging.models.TaggedItemManager-class.html#get_by_model"><a title="digichef.tagging.models.TaggedItemManager.get_by_model" class="py-name" href="#" onclick="return doclink('link-32', 'get_by_model', 'link-32');">get_by_model</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-33" class="py-name"><a title="digichef.profiles.forms.ProfileForm.Meta.model
digichef.tagging.forms.TagAdminForm.Meta.model" class="py-name" href="#" onclick="return doclink('link-33', 'model', 'link-7');">model</a></tt><tt class="py-op">,</tt> <tt id="link-34" class="py-name"><a title="digichef.recipes.models.Recipe.tags
digichef.tagging.tests.models.FormTest.tags" class="py-name" href="#" onclick="return doclink('link-34', 'tags', 'link-17');">tags</a></tt><tt class="py-op">)</tt> </tt>
<a name="L41"></a><tt class="py-lineno">41</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L42"></a><tt class="py-lineno">42</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt id="link-35" class="py-name"><a title="digichef.tagging.models.TaggedItem" class="py-name" href="#" onclick="return doclink('link-35', 'TaggedItem', 'link-5');">TaggedItem</a></tt><tt class="py-op">.</tt><tt id="link-36" class="py-name"><a title="digichef.recommender.models.Recommender.objects
digichef.registration.models.RegistrationProfile.objects
digichef.tagging.models.Tag.objects
digichef.tagging.models.TaggedItem.objects
digichef.voting.models.Vote.objects" class="py-name" href="#" onclick="return doclink('link-36', 'objects', 'link-6');">objects</a></tt><tt class="py-op">.</tt><tt id="link-37" class="py-name"><a title="digichef.tagging.models.TaggedItemManager.get_by_model" class="py-name" href="#" onclick="return doclink('link-37', 'get_by_model', 'link-32');">get_by_model</a></tt><tt class="py-op">(</tt><tt class="py-name">queryset</tt><tt class="py-op">,</tt> <tt id="link-38" class="py-name"><a title="digichef.recipes.models.Recipe.tags
digichef.tagging.tests.models.FormTest.tags" class="py-name" href="#" onclick="return doclink('link-38', 'tags', 'link-17');">tags</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="L43"></a><tt class="py-lineno">43</tt>  <tt class="py-line"> </tt>
<a name="ModelTaggedItemManager.with_any"></a><div id="ModelTaggedItemManager.with_any-def"><a name="L44"></a><tt class="py-lineno">44</tt> <a class="py-toggle" href="#" id="ModelTaggedItemManager.with_any-toggle" onclick="return toggle('ModelTaggedItemManager.with_any');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="digichef.tagging.managers.ModelTaggedItemManager-class.html#with_any">with_any</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">tags</tt><tt class="py-op">,</tt> <tt class="py-param">queryset</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ModelTaggedItemManager.with_any-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="ModelTaggedItemManager.with_any-expanded"><a name="L45"></a><tt class="py-lineno">45</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">queryset</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L46"></a><tt class="py-lineno">46</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt id="link-39" class="py-name"><a title="digichef.tagging.models.TaggedItem" class="py-name" href="#" onclick="return doclink('link-39', 'TaggedItem', 'link-5');">TaggedItem</a></tt><tt class="py-op">.</tt><tt id="link-40" class="py-name"><a title="digichef.recommender.models.Recommender.objects
digichef.registration.models.RegistrationProfile.objects
digichef.tagging.models.Tag.objects
digichef.tagging.models.TaggedItem.objects
digichef.voting.models.Vote.objects" class="py-name" href="#" onclick="return doclink('link-40', 'objects', 'link-6');">objects</a></tt><tt class="py-op">.</tt><tt id="link-41" class="py-name" targets="Method digichef.tagging.models.TaggedItemManager.get_union_by_model()=digichef.tagging.models.TaggedItemManager-class.html#get_union_by_model"><a title="digichef.tagging.models.TaggedItemManager.get_union_by_model" class="py-name" href="#" onclick="return doclink('link-41', 'get_union_by_model', 'link-41');">get_union_by_model</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-42" class="py-name"><a title="digichef.profiles.forms.ProfileForm.Meta.model
digichef.tagging.forms.TagAdminForm.Meta.model" class="py-name" href="#" onclick="return doclink('link-42', 'model', 'link-7');">model</a></tt><tt class="py-op">,</tt> <tt id="link-43" class="py-name"><a title="digichef.recipes.models.Recipe.tags
digichef.tagging.tests.models.FormTest.tags" class="py-name" href="#" onclick="return doclink('link-43', 'tags', 'link-17');">tags</a></tt><tt class="py-op">)</tt> </tt>
<a name="L47"></a><tt class="py-lineno">47</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L48"></a><tt class="py-lineno">48</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt id="link-44" class="py-name"><a title="digichef.tagging.models.TaggedItem" class="py-name" href="#" onclick="return doclink('link-44', 'TaggedItem', 'link-5');">TaggedItem</a></tt><tt class="py-op">.</tt><tt id="link-45" class="py-name"><a title="digichef.recommender.models.Recommender.objects
digichef.registration.models.RegistrationProfile.objects
digichef.tagging.models.Tag.objects
digichef.tagging.models.TaggedItem.objects
digichef.voting.models.Vote.objects" class="py-name" href="#" onclick="return doclink('link-45', 'objects', 'link-6');">objects</a></tt><tt class="py-op">.</tt><tt id="link-46" class="py-name"><a title="digichef.tagging.models.TaggedItemManager.get_union_by_model" class="py-name" href="#" onclick="return doclink('link-46', 'get_union_by_model', 'link-41');">get_union_by_model</a></tt><tt class="py-op">(</tt><tt class="py-name">queryset</tt><tt class="py-op">,</tt> <tt id="link-47" class="py-name"><a title="digichef.recipes.models.Recipe.tags
digichef.tagging.tests.models.FormTest.tags" class="py-name" href="#" onclick="return doclink('link-47', 'tags', 'link-17');">tags</a></tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L49"></a><tt class="py-lineno">49</tt>  <tt class="py-line"> </tt>
<a name="TagDescriptor"></a><div id="TagDescriptor-def"><a name="L50"></a><tt class="py-lineno">50</tt> <a class="py-toggle" href="#" id="TagDescriptor-toggle" onclick="return toggle('TagDescriptor');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="digichef.tagging.managers.TagDescriptor-class.html">TagDescriptor</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="TagDescriptor-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="TagDescriptor-expanded"><a name="L51"></a><tt class="py-lineno">51</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L52"></a><tt class="py-lineno">52</tt>  <tt class="py-line"><tt class="py-docstring">    A descriptor which provides access to a ``ModelTagManager`` for</tt> </tt>
<a name="L53"></a><tt class="py-lineno">53</tt>  <tt class="py-line"><tt class="py-docstring">    model classes and simple retrieval, updating and deletion of tags</tt> </tt>
<a name="L54"></a><tt class="py-lineno">54</tt>  <tt class="py-line"><tt class="py-docstring">    for model instances.</tt> </tt>
<a name="L55"></a><tt class="py-lineno">55</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="TagDescriptor.__get__"></a><div id="TagDescriptor.__get__-def"><a name="L56"></a><tt class="py-lineno">56</tt> <a class="py-toggle" href="#" id="TagDescriptor.__get__-toggle" onclick="return toggle('TagDescriptor.__get__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="digichef.tagging.managers.TagDescriptor-class.html#__get__">__get__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">instance</tt><tt class="py-op">,</tt> <tt class="py-param">owner</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="TagDescriptor.__get__-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="TagDescriptor.__get__-expanded"><a name="L57"></a><tt class="py-lineno">57</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">instance</tt><tt class="py-op">:</tt> </tt>
<a name="L58"></a><tt class="py-lineno">58</tt>  <tt class="py-line">            <tt class="py-name">tag_manager</tt> <tt class="py-op">=</tt> <tt id="link-48" class="py-name" targets="Class digichef.tagging.managers.ModelTagManager=digichef.tagging.managers.ModelTagManager-class.html"><a title="digichef.tagging.managers.ModelTagManager" class="py-name" href="#" onclick="return doclink('link-48', 'ModelTagManager', 'link-48');">ModelTagManager</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L59"></a><tt class="py-lineno">59</tt>  <tt class="py-line">            <tt class="py-name">tag_manager</tt><tt class="py-op">.</tt><tt id="link-49" class="py-name"><a title="digichef.profiles.forms.ProfileForm.Meta.model
digichef.tagging.forms.TagAdminForm.Meta.model" class="py-name" href="#" onclick="return doclink('link-49', 'model', 'link-7');">model</a></tt> <tt class="py-op">=</tt> <tt class="py-name">owner</tt> </tt>
<a name="L60"></a><tt class="py-lineno">60</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">tag_manager</tt> </tt>
<a name="L61"></a><tt class="py-lineno">61</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L62"></a><tt class="py-lineno">62</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt id="link-50" class="py-name"><a title="digichef.tagging.models.Tag" class="py-name" href="#" onclick="return doclink('link-50', 'Tag', 'link-4');">Tag</a></tt><tt class="py-op">.</tt><tt id="link-51" class="py-name"><a title="digichef.recommender.models.Recommender.objects
digichef.registration.models.RegistrationProfile.objects
digichef.tagging.models.Tag.objects
digichef.tagging.models.TaggedItem.objects
digichef.voting.models.Vote.objects" class="py-name" href="#" onclick="return doclink('link-51', 'objects', 'link-6');">objects</a></tt><tt class="py-op">.</tt><tt id="link-52" class="py-name" targets="Method digichef.tagging.models.TagManager.get_for_object()=digichef.tagging.models.TagManager-class.html#get_for_object"><a title="digichef.tagging.models.TagManager.get_for_object" class="py-name" href="#" onclick="return doclink('link-52', 'get_for_object', 'link-52');">get_for_object</a></tt><tt class="py-op">(</tt><tt class="py-name">instance</tt><tt class="py-op">)</tt> </tt>
</div><a name="L63"></a><tt class="py-lineno">63</tt>  <tt class="py-line"> </tt>
<a name="TagDescriptor.__set__"></a><div id="TagDescriptor.__set__-def"><a name="L64"></a><tt class="py-lineno">64</tt> <a class="py-toggle" href="#" id="TagDescriptor.__set__-toggle" onclick="return toggle('TagDescriptor.__set__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="digichef.tagging.managers.TagDescriptor-class.html#__set__">__set__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">instance</tt><tt class="py-op">,</tt> <tt class="py-param">value</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="TagDescriptor.__set__-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="TagDescriptor.__set__-expanded"><a name="L65"></a><tt class="py-lineno">65</tt>  <tt class="py-line">        <tt id="link-53" class="py-name"><a title="digichef.tagging.models.Tag" class="py-name" href="#" onclick="return doclink('link-53', 'Tag', 'link-4');">Tag</a></tt><tt class="py-op">.</tt><tt id="link-54" class="py-name"><a title="digichef.recommender.models.Recommender.objects
digichef.registration.models.RegistrationProfile.objects
digichef.tagging.models.Tag.objects
digichef.tagging.models.TaggedItem.objects
digichef.voting.models.Vote.objects" class="py-name" href="#" onclick="return doclink('link-54', 'objects', 'link-6');">objects</a></tt><tt class="py-op">.</tt><tt id="link-55" class="py-name" targets="Method digichef.tagging.models.TagManager.update_tags()=digichef.tagging.models.TagManager-class.html#update_tags"><a title="digichef.tagging.models.TagManager.update_tags" class="py-name" href="#" onclick="return doclink('link-55', 'update_tags', 'link-55');">update_tags</a></tt><tt class="py-op">(</tt><tt class="py-name">instance</tt><tt class="py-op">,</tt> <tt class="py-name">value</tt><tt class="py-op">)</tt> </tt>
</div><a name="L66"></a><tt class="py-lineno">66</tt>  <tt class="py-line"> </tt>
<a name="TagDescriptor.__delete__"></a><div id="TagDescriptor.__delete__-def"><a name="L67"></a><tt class="py-lineno">67</tt> <a class="py-toggle" href="#" id="TagDescriptor.__delete__-toggle" onclick="return toggle('TagDescriptor.__delete__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="digichef.tagging.managers.TagDescriptor-class.html#__delete__">__delete__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">instance</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="TagDescriptor.__delete__-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="TagDescriptor.__delete__-expanded"><a name="L68"></a><tt class="py-lineno">68</tt>  <tt class="py-line">        <tt id="link-56" class="py-name"><a title="digichef.tagging.models.Tag" class="py-name" href="#" onclick="return doclink('link-56', 'Tag', 'link-4');">Tag</a></tt><tt class="py-op">.</tt><tt id="link-57" class="py-name"><a title="digichef.recommender.models.Recommender.objects
digichef.registration.models.RegistrationProfile.objects
digichef.tagging.models.Tag.objects
digichef.tagging.models.TaggedItem.objects
digichef.voting.models.Vote.objects" class="py-name" href="#" onclick="return doclink('link-57', 'objects', 'link-6');">objects</a></tt><tt class="py-op">.</tt><tt id="link-58" class="py-name"><a title="digichef.tagging.models.TagManager.update_tags" class="py-name" href="#" onclick="return doclink('link-58', 'update_tags', 'link-55');">update_tags</a></tt><tt class="py-op">(</tt><tt class="py-name">instance</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L69"></a><tt class="py-lineno">69</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Thu Apr  1 02:28:32 2010
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
